3.16.27 \(\int \frac {(b+2 c x) (d+e x)}{a+b x+c x^2} \, dx\) [1527]

Optimal. Leaf size=70 \[ 2 e x-\frac {\sqrt {b^2-4 a c} e \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c}+\frac {(2 c d-b e) \log \left (a+b x+c x^2\right )}{2 c} \]

[Out]

2*e*x+1/2*(-b*e+2*c*d)*ln(c*x^2+b*x+a)/c-e*arctanh((2*c*x+b)/(-4*a*c+b^2)^(1/2))*(-4*a*c+b^2)^(1/2)/c

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 70, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {787, 648, 632, 212, 642} \begin {gather*} -\frac {e \sqrt {b^2-4 a c} \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c}+\frac {(2 c d-b e) \log \left (a+b x+c x^2\right )}{2 c}+2 e x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((b + 2*c*x)*(d + e*x))/(a + b*x + c*x^2),x]

[Out]

2*e*x - (Sqrt[b^2 - 4*a*c]*e*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/c + ((2*c*d - b*e)*Log[a + b*x + c*x^2])/
(2*c)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 787

Int[(((d_.) + (e_.)*(x_))*((f_) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[e*g*(x/c
), x] + Dist[1/c, Int[(c*d*f - a*e*g + (c*e*f + c*d*g - b*e*g)*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c,
 d, e, f, g}, x] && NeQ[b^2 - 4*a*c, 0]

Rubi steps

\begin {align*} \int \frac {(b+2 c x) (d+e x)}{a+b x+c x^2} \, dx &=2 e x+\frac {\int \frac {b c d-2 a c e+\left (2 c^2 d-b c e\right ) x}{a+b x+c x^2} \, dx}{c}\\ &=2 e x+\frac {\left (\left (b^2-4 a c\right ) e\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 c}+\frac {(2 c d-b e) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 c}\\ &=2 e x+\frac {(2 c d-b e) \log \left (a+b x+c x^2\right )}{2 c}-\frac {\left (\left (b^2-4 a c\right ) e\right ) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c}\\ &=2 e x-\frac {\sqrt {b^2-4 a c} e \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c}+\frac {(2 c d-b e) \log \left (a+b x+c x^2\right )}{2 c}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 72, normalized size = 1.03 \begin {gather*} \frac {4 c e x-2 \sqrt {-b^2+4 a c} e \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )+(2 c d-b e) \log (a+x (b+c x))}{2 c} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((b + 2*c*x)*(d + e*x))/(a + b*x + c*x^2),x]

[Out]

(4*c*e*x - 2*Sqrt[-b^2 + 4*a*c]*e*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]] + (2*c*d - b*e)*Log[a + x*(b + c*x)])
/(2*c)

________________________________________________________________________________________

Maple [A]
time = 0.84, size = 88, normalized size = 1.26

method result size
default \(2 e x +\frac {\left (-b e +2 c d \right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (-2 a e +b d -\frac {\left (-b e +2 c d \right ) b}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}\) \(88\)
risch \(2 e x -\frac {\ln \left (-2 \sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, c x -4 a c e +b^{2} e -\sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, b \right ) b e}{2 c}+\ln \left (-2 \sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, c x -4 a c e +b^{2} e -\sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, b \right ) d +\frac {\ln \left (-2 \sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, c x -4 a c e +b^{2} e -\sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, b \right ) \sqrt {-e^{2} \left (4 a c -b^{2}\right )}}{2 c}-\frac {\ln \left (2 \sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, c x -4 a c e +b^{2} e +\sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, b \right ) b e}{2 c}+\ln \left (2 \sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, c x -4 a c e +b^{2} e +\sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, b \right ) d -\frac {\ln \left (2 \sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, c x -4 a c e +b^{2} e +\sqrt {-e^{2} \left (4 a c -b^{2}\right )}\, b \right ) \sqrt {-e^{2} \left (4 a c -b^{2}\right )}}{2 c}\) \(383\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*c*x+b)*(e*x+d)/(c*x^2+b*x+a),x,method=_RETURNVERBOSE)

[Out]

2*e*x+1/2*(-b*e+2*c*d)*ln(c*x^2+b*x+a)/c+2*(-2*a*e+b*d-1/2*(-b*e+2*c*d)*b/c)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b
)/(4*a*c-b^2)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*c*x+b)*(e*x+d)/(c*x^2+b*x+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more deta

________________________________________________________________________________________

Fricas [A]
time = 3.41, size = 182, normalized size = 2.60 \begin {gather*} \left [\frac {4 \, c x e + \sqrt {b^{2} - 4 \, a c} e \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c - \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + {\left (2 \, c d - b e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c}, \frac {4 \, c x e - 2 \, \sqrt {-b^{2} + 4 \, a c} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) e + {\left (2 \, c d - b e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*c*x+b)*(e*x+d)/(c*x^2+b*x+a),x, algorithm="fricas")

[Out]

[1/2*(4*c*x*e + sqrt(b^2 - 4*a*c)*e*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c - sqrt(b^2 - 4*a*c)*(2*c*x + b))/(c
*x^2 + b*x + a)) + (2*c*d - b*e)*log(c*x^2 + b*x + a))/c, 1/2*(4*c*x*e - 2*sqrt(-b^2 + 4*a*c)*arctan(-sqrt(-b^
2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c))*e + (2*c*d - b*e)*log(c*x^2 + b*x + a))/c]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 134 vs. \(2 (61) = 122\).
time = 0.37, size = 134, normalized size = 1.91 \begin {gather*} 2 e x + \left (- \frac {e \sqrt {- 4 a c + b^{2}}}{2 c} - \frac {b e - 2 c d}{2 c}\right ) \log {\left (x + \frac {d + \frac {e \sqrt {- 4 a c + b^{2}}}{2 c} + \frac {b e - 2 c d}{2 c}}{e} \right )} + \left (\frac {e \sqrt {- 4 a c + b^{2}}}{2 c} - \frac {b e - 2 c d}{2 c}\right ) \log {\left (x + \frac {d - \frac {e \sqrt {- 4 a c + b^{2}}}{2 c} + \frac {b e - 2 c d}{2 c}}{e} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*c*x+b)*(e*x+d)/(c*x**2+b*x+a),x)

[Out]

2*e*x + (-e*sqrt(-4*a*c + b**2)/(2*c) - (b*e - 2*c*d)/(2*c))*log(x + (d + e*sqrt(-4*a*c + b**2)/(2*c) + (b*e -
 2*c*d)/(2*c))/e) + (e*sqrt(-4*a*c + b**2)/(2*c) - (b*e - 2*c*d)/(2*c))*log(x + (d - e*sqrt(-4*a*c + b**2)/(2*
c) + (b*e - 2*c*d)/(2*c))/e)

________________________________________________________________________________________

Giac [A]
time = 1.26, size = 81, normalized size = 1.16 \begin {gather*} 2 \, x e + \frac {{\left (2 \, c d - b e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c} + \frac {{\left (b^{2} e - 4 \, a c e\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*c*x+b)*(e*x+d)/(c*x^2+b*x+a),x, algorithm="giac")

[Out]

2*x*e + 1/2*(2*c*d - b*e)*log(c*x^2 + b*x + a)/c + (b^2*e - 4*a*c*e)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/(s
qrt(-b^2 + 4*a*c)*c)

________________________________________________________________________________________

Mupad [B]
time = 0.32, size = 129, normalized size = 1.84 \begin {gather*} \ln \left (b\,\sqrt {b^2-4\,a\,c}-4\,a\,c+b^2+2\,c\,x\,\sqrt {b^2-4\,a\,c}\right )\,\left (d-\frac {\frac {b\,e}{2}+\frac {e\,\sqrt {b^2-4\,a\,c}}{2}}{c}\right )+2\,e\,x+\ln \left (4\,a\,c+b\,\sqrt {b^2-4\,a\,c}-b^2+2\,c\,x\,\sqrt {b^2-4\,a\,c}\right )\,\left (d-\frac {\frac {b\,e}{2}-\frac {e\,\sqrt {b^2-4\,a\,c}}{2}}{c}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((b + 2*c*x)*(d + e*x))/(a + b*x + c*x^2),x)

[Out]

log(b*(b^2 - 4*a*c)^(1/2) - 4*a*c + b^2 + 2*c*x*(b^2 - 4*a*c)^(1/2))*(d - ((b*e)/2 + (e*(b^2 - 4*a*c)^(1/2))/2
)/c) + 2*e*x + log(4*a*c + b*(b^2 - 4*a*c)^(1/2) - b^2 + 2*c*x*(b^2 - 4*a*c)^(1/2))*(d - ((b*e)/2 - (e*(b^2 -
4*a*c)^(1/2))/2)/c)

________________________________________________________________________________________